package com.framework.modules.user.service.impl;

import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.framework.common.utils.PageUtils;
import com.framework.common.utils.Query;

import com.framework.modules.user.dao.UserWithdrawHistoryDao;
import com.framework.modules.user.entity.UserWithdrawHistoryEntity;
import com.framework.modules.user.service.UserWithdrawHistoryService;


@Service("userWithdrawHistoryService")
public class UserWithdrawHistoryServiceImpl extends ServiceImpl<UserWithdrawHistoryDao, UserWithdrawHistoryEntity> implements UserWithdrawHistoryService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        EntityWrapper wrapper=new EntityWrapper<UserWithdrawHistoryEntity>();
        if(params.containsKey("uid")){
            wrapper.eq("uid",params.get("uid"));
        }
        Page<UserWithdrawHistoryEntity> page = this.selectPage(
                new Query<UserWithdrawHistoryEntity>(params).getPage(),
                wrapper
        );
        return new PageUtils(page);
    }

    @Override
    public PageUtils queryLiveWithdrawHistory(Map<String, Object> params) {
        Page page=new Page(Integer.parseInt(params.get("page").toString()),Integer.parseInt(params.get("limit").toString()));
        return new PageUtils(page.setRecords(this.baseMapper.queryLiveWithdrawHistory(page,params)));
    }

}
